export function getSetting() {
  wx.getSetting({
    success(res) {
      if (
        !res.authSetting['scope.userInfo'] ||
        !res.authSetting['scope.userLocation']
      ) {
        wx.openSetting({
          success: res => {
            if (
              res.authSetting['scope.userLocation'] == false ||
              res.authSetting['scope.userLocation']
            ) {
              getPosition()
            }
            if (res.authSetting['scope.userInfo'] == false) {
              getUserInfo()
            }
          }
        })
      }
    }
  })
}
